Recording apparatus and method, and reproducing apparatus and method

ABSTRACT

A selector has both a function for creating a header of a sequence layer and a header of a picture layer corresponding to reproduced data of a system area and a function for outputting one of an input stream and a stream of which a created header has been added to the header of the input stream as an output stream. When the mode is not high speed reproducing mode, the selector outputs the header contained in the input stream as a header of the output stream. When the mode is high speed reproducing mode, a header (the header of the sequence layer and the header of the picture layer) is created corresponding to data reproduced from the system area. The selector outputs an output stream of which the created header has been added to the input stream.

TECHNICAL FIELD

The present invention relates to a recording apparatus and a recordingmethod for recording a digital video signal to a tape shaped recordmedium and also to a reproducing apparatus and a reproducing method forreproducing a digital video signal from a tape shaped record medium.

BACKGROUND ART

As exemplified with a digital VTR (Video Tape Recorder), a datarecording and reproducing apparatus that records a digital video signaland a digital audio signal to a record medium and reproduces themtherefrom is known. Since the data capacity of a digital video signal ishuge, conventionally, it is compression-encoded corresponding to apredetermined method and then the encoded data is recorded to a recordmedium. In recent years, MPEG2 (Moving Picture Experts Group phase 2) isknown as a compression-encoding standard.

In picture compression technologies such as the above-mentioned MPEG2,the data compression ratio is improved using variable length code. Thus,depending on the complexity of a picture that is compressed, the amountof compressed code per screen (for example, per frame or per field)fluctuates.

On the other hand, in a recording apparatus that records a video signalto a record medium such as a magnetic tape or a disc record medium,particularly, in a VTR, a predetermined unit such as one frame or onefield is used as a unit of a fixed length. In other words, the amount ofcode per frame or field is limited to a predetermined value or less andrecorded to a fixed capacity area of a storage medium.

The reason why the fixed length format is used for a VTR is in thatsince each record area on a magnetic tape as a record medium is composedof one frame, record data for one frame should be just placed in eachrecord area. In addition, since the record medium is used correspondingto record time, the total amount of record data on the record medium andthe remaining amount thereof can be accurately obtained. As anotheradvantage, a program start position detecting process can be easilyperformed in a high speed searching operation. In addition, from a viewpoint of controlling of a record medium, if the record medium is amagnetic tape, when data is recorded in the fixed length format, sincethe magnetic tape that is dynamically driven can be traveled at aconstant speed, the magnetic tape can be stably controlled. Likewise,these advantages can apply to disc shaped record mediums.

The variable length code encoding format and the fixed length formathave such contrary characteristics. In recent years, a recordingapparatus that inputs a video signal as a non-compressed base bandsignal, compression-encodes the signal with variable length codecorresponding to MPEG2 or JPEG (Joint Photographic Experts Group), andrecords the encoded signal to a record medium is known. In addition, arecording and reproducing apparatus that directly inputs and outputs astream that has been compression-encoded with variable length code andrecords and reproduces the stream has been also proposed. In thefollowing description, it is assumed that the compression encodingformat for a digital video signal is MPEG2.

Next, the structure of an MPEG2 data stream will be described in brief.MPEG2 is a combination of a motion compensation predictive encoding anda compression encoding using DCT. MPEG2 data is hierarchicallystructured. The MPEG2 data is composed of a block layer as the lowestlayer, a macro block layer, a slice layer, a picture layer, a GOP (GroupOf Picture) layer, and a sequence layer as the highest layer.

The block layer is composed of DCT blocks each of which is a data unitfor DCT. The macro block layer is composed of a plurality of DCT blocks.The slice layer is composed of a header portion and at least one macroblock. The picture layer is composed of a header portion and at leastone slice. One picture corresponds to one screen. The GOP layer iscomposed of a header portion, an I picture (Intra-coded picture), a Ppicture (Predictive-coded picture), and a B picture (Bidirectionallypredictive-coded picture).

The I picture uses information of only a picture that is encoded. Thus,the I picture can be decoded as it is. The P picture uses an I pictureor a P picture that has been decoded before the current P picture isdecoded. The difference between the current P picture and the motioncompensated predictive picture is encoded or the current P picture isencoded without the difference. One of them is selected for each macroblock depending on which is more effective. The B picture uses (1) an Ipicture or a P picture that has been decoded before the current Bpicture is decoded, (2) an I picture or a P picture that has beendecoded before the current B picture is decoded, or (3) an interpolatedpicture of (1) and (2). The difference between the current B picture andeach of the three types of the motion compensated predictive pictures isencoded or the current B picture is encoded without the difference. Oneof them is selected for each macro block depending on which is the mosteffective.

Thus, as types of macro blocks, there are an intra-frame encoded macroblock, a forward inter-frame predictive macro block of which a futuremacro block is predicted with a past macro block, a backward interframepredictive macro block of which a past macro block is predicted with afuture macro block, and a bidirectional macro block that is predicted inboth the forward and backward directions. All macro blocks in an Ipicture are all intra-frame macro blocks. A P picture contains anintra-frame macro block and a forward inter-frame predictive macroblock. A B picture contains all the four types of macro blocks.

A macro block is a set of a plurality of DCT blocks and formed bydividing one screen (picture) into a lattice of 16 pixels×16 lines. Aslice is formed by connecting macro blocks for example in the horizontaldirection. The number of macro blocks per one screen depends on the sizethereof.

In the MPEG format, one slice is one variable length code sequence. Thevariable length code sequence is a sequence of which the boundary ofdata cannot be detected unless variable length code is correctlydecoded. When an MPEG stream is decoded, the header portion of a sliceis detected so as to obtain the start point and the end point ofvariable length code.

In MPEG, conventionally, one slice is composed of one stripe (16 lines).The variable length encoding starts at the left edge of the screen andends at the right edge of the screen. Thus, when a VTR has recorded anMPEG elementary stream, if it is reproduced at high speed, the VTRmainly reproduces the left edge of the screen. Thus, the screen cannotbe equally updated. In addition, since the position on the tape cannotbe predicted, if a tape pattern is traced at predetermined intervals,the screen cannot be equally updated. Moreover, if at least one errortakes place, it adversely affects until the right edge of the screen.Thus, until the next slice header is detected, the error continues.Thus, when one slice is preferably composed of one macro block, such aninconvenience can be solved.

On the other hand, a video signal is recorded on a magnetic tape inhelical track format of which tracks are diagonally formed with arotating head. On one track, sync blocks, each of which is the minimumrecord unit, are grouped for each data type as sectors. In addition,data for one frame is recorded as a plurality of tracks.

In MPEG, to allow data to be accessed at random, a GOP (Group OfPicture) structure as a group of a plurality of pictures is defined. Theprovisions with respect to GOP in MPEG state that firstly the firstpicture of a GOP as a stream is an I picture and that secondly the lastpicture of a GOP in the order of original pictures is an I picture or aP picture. In addition, as a GOP, a structure of which a predictionusing the last I picture or P picture of an earlier GOP is required ispermitted. A GOP that can be decoded without need to use a picture of anearlier GOP is referred to as closed GOP.

In a digital VTR, an editing process is normally performed. The editingprocess is preferably performed in as small data unit as possible. Whenan MPEG2 stream has been recorded, one GOP may be used as an edit unit.In the structure of a closed GOP of which a GOP can be decoded withoutneed to use an earlier GOP or a later GOP, an editing process can beperformed for each GOP. However, when a GOP is composed of for example15 frames, the editing unit is too large. Thus, it is preferred toperform an editing process in the accuracy of frame (picture).

However, when an MPEG stream contains a predictive picture that requiresan earlier picture or both an earlier picture and a later picture fordecoding the predictive picture, it becomes impossible to perform theediting process for each frame. Thus, preferably, all pictures areencoded with intra-frame code and one GOP is composed of oneintra-picture. Such a stream satisfies the encoding syntax of MPEG2.

In addition, at the beginning of each of the sequence layer, the GOPlayer, the picture layer, the slice layer, and the macro block layer,identification code composed of a predetermined bit pattern is placed.The identification code is followed by a header portion that containsencoding parameters of each layer. An MPEG decoder that performs anMPEG2-decoding process extracts identification code by apattern-matching operation, determines the hierarchical level, anddecodes the MPEG stream corresponding to the parameter informationcontained in the header portion. The header of each layer lower than thepicture layer is information necessary for each frame. Thus, the headershould be added to each frame. In contrast, the header of the sequencelayer should be added to each sequence or each GOP. In other words, itis not necessary to add the header of the sequence layer to each frame.

Information contained in the header of the sequence layer is number ofpixels, bit rate, profile, level, color difference format, progressivesequence, and so forth. These information is normally the same in allthe sequence when it is assumed that one video tape is one sequence.According to the encoding syntax of MPEG, the header of the sequencelayer can be added at the beginning of the video tape. In addition,according to the encoding syntax of MPEG, a quantizing matrix may bepresent in the header of other than the sequence layer (namely, theheader of the sequence layer or the header of the picture layer).According to the encoding syntax of MPEG, the quantizing matrix can beadded or omitted.

As information contained in the header of the picture layer, theaccuracy of DC (Direct Current) coefficient of an intra macro block isset; the frame structure, field structure, and display field aredesignated; the quantizing scale is selected; the VLC type is selected;the zigzag/alternate scanning is selected; and the chroma format and soforth are designated. To allow an input picture to be effectivelyencoded corresponding to the characteristic thereof, the header of thesequence layer and the header of the picture layer can be changed foreach frame.

In a digital VTR, an MPEG stream is recorded on a magnetic tape with arotating head. Diagonal tracks are successively formed on the magnetictape. In the normal reproducing operation whose tape speed is the sameas the recording operation, since all recorded data can be reproduced,even if the header information is changed for each frame, no problemtakes place. However, in the high speed reproducing operation whose tapespeed is higher than the recording operation (for example, twice orhigher), since data of the tape is fragmentarily reproduced, ifinformation of the header is changed for each frame, a problem takesplace.

FIG. 26 conceptually shows reproduced data in the high speed reproducingoperation. Data of each of frame 1, frame 2, frame 3, . . . and so forthis composed of a header and picture data. There are a sequence header, aGOP header, and a picture header. The picture header is always added toeach frame. In the high speed reproducing operation, data shaded in thedrawing is fragmentarily reproduced from each frame. The obtained datareproduces a picture of one frame.

As was described above, to allow an input picture to be effectivelyencoded corresponding to the characteristic thereof, the header of thesequence layer and the header of the picture layer can be changed foreach frame. Thus, if the header of frame 1 is different from the headerof picture data of another frame, frame 1 cannot be correctly decoded.

Therefore, an object of the present invention is to provide a recordingapparatus, a recording method, a reproducing apparatus, and areproducing method that allow compression-encoded data fragmentarilyreproduced in the high speed reproducing operation to be decoded to apicture.

DISCLOSURE OF THE INVENTION

Claim 1 of the present invention is a recording apparatus for recordinga digital video signal to a tape shaped record medium, comprising ameans for recording a stream in which a compression encoding has beenperformed and a header has been added to the tape shaped record medium,wherein information of the header added to each frame is the same in allframes.

Claim 5 of the present invention is a recording method for recording adigital video signal to a tape shaped record medium, comprising the stepof recording a stream in which a compression encoding has been performedand a header has been added to the tape shaped record medium, whereininformation of the header added to each frame is the same in all frames.

According to claims 1 and 5 of the present invention, since informationof a header is the same in all frames, even if data of a plurality offrames is fragmentarily reproduced in the high speed reproducingoperation, the reproduced data can be almost securely decoded.

Claim 6 of the present invention is a recording apparatus for recordinga digital video signal to a tape shaped record medium, comprising ameans for recording a stream in which compression encoding has beenperformed and a header has been added to the tape shaped record medium,wherein a system area that is almost securely reproduced in a high speedreproducing operation of which the tape shaped record medium is traveledat higher speed than a recording operation is formed as an areaseparated from a record area for the stream, and wherein at least partof the header is recorded to the system area.

Claim 10 of the present invention is a recording method for recording adigital video signal to a tape shaped record medium, comprising the stepof recording a stream in which compression encoding has been performedand a header has been added to the tape shaped record medium, wherein asystem area that is almost securely reproduced in a high speedreproducing operation of which the tape shaped record medium is traveledat higher speed than a recording operation is formed as an areaseparated from a record area for the stream, and wherein at least partof the header is recorded to the system area.

Claim 11 of the present invention is a reproducing apparatus forreproducing a tape shaped record medium on which a stream has beenrecorded, in the stream, compression encoding having been performed anda header having been added, at least part of the header having beenrecorded in a system area that is almost securely reproduced in a highspeed reproducing operation of which the tape shaped record medium istraveled at higher speed than a recording operation and that is formedas an area separated from a record area for the stream, wherein in thehigh speed reproducing operation, the reproduced stream is decoded usinginformation contained in the header reproduced from the system area.

Claim 15 of the present invention is a reproducing method forreproducing a tape shaped record medium on which a stream has beenrecorded, in the stream, compression encoding having been performed anda header having been added, at least part of the header having beenrecorded in a system area that is almost securely reproduced in a highspeed reproducing operation of which the tape shaped record medium istraveled at higher speed than a recording operation and that is formedas an area separated from a record area for the stream, wherein in thehigh speed reproducing operation, the reproduced stream is decoded usinginformation contained in the header reproduced from the system area.

Claim 16 of the present invention is a recording apparatus for recordinga digital video signal to a tape shaped record medium, comprising ameans for recording a stream in which a compression encoding has beenperformed and a header has been added to the tape shaped record medium,wherein information of the header added to each frame is the same in allframes, wherein a system area that is almost securely reproduced in ahigh speed reproducing operation of which the tape shaped record mediumis traveled at higher speed than a recording operation is formed as anarea separated from a record area for the stream, and wherein at leastpart of the header is recorded to the system area.

According to claims 6, 10, 11, and 15 of the present invention, since atleast part of information of a header is recorded to a system area thatcan be almost securely reproduced in the high speed reproducingoperation, even if the header portion cannot be reproduced, thereproduced data can be decoded. According to claim 16 of the presentinvention, since information of a header is the same in all frames andat least part of information of the header is recorded to the systemarea, the reproduced data can be more securely decoded in the high speedreproducing operation.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram showing the hierarchical structure of aconventional MPEG2 stream.

FIG. 2 is a schematic diagram showing the contents of data placed in anMPEG2 stream and bit assignments thereof.

FIG. 3 is a schematic diagram showing the contents of data placed in anMPEG2 stream and bit assignments thereof.

FIG. 4 is a schematic diagram showing the contents of data placed in anMPEG2 stream and bit assignments thereof.

FIG. 5 is a schematic diagram showing the contents of data placed in anMPEG2 stream and bit assignments thereof.

FIG. 6 is a schematic diagram showing the contents of data placed in anMPEG2 stream and bit assignments thereof.

FIG. 7 is a schematic diagram showing the contents of data placed in anMPEG2 stream and bit assignments thereof.

FIG. 8 is a schematic diagram showing the contents of data placed in anMPEG2 stream and bit assignments thereof.

FIG. 9 is a schematic diagram showing the contents of data placed in anMPEG2 stream and bit assignments thereof.

FIG. 10 is a schematic diagram showing the contents of data placed in anMPEG2 stream and bit assignments thereof.

FIG. 11 is a schematic diagram showing the contents of data placed in anMPEG2 stream and bit assignments thereof.

FIG. 12 is a schematic diagram showing the contents of data placed in anMPEG2 stream and bit assignments thereof.

FIG. 13 is a schematic diagram for explaining an arrangement of bytes ofdata.

FIG. 14 is a schematic diagram showing the data structure of an MPEGstream according to the embodiment of the present invention.

FIG. 15 is a block diagram showing an example of the structure of arecording and reproducing apparatus according to the embodiment of thepresent invention.

FIG. 16 is a schematic diagram showing an example of a format of tracksformed on a magnetic tape and the structure of data recorded in a systemarea.

FIG. 17 is a schematic diagram for explaining an output method and avariable length encoding of a video encoder.

FIG. 18 is a schematic diagram for explaining the rearrangement of anoutput sequence of the video encoder.

FIG. 19 is a schematic diagram for explaining a process for packing thesequence rearranged data to sync blocks.

FIG. 20 is a schematic diagram showing in reality the packing process.

FIG. 21 is a block diagram showing a more practical structure of an ECCencoder.

FIG. 22 is a schematic diagram showing an example of an addressstructure of a main memory.

FIG. 23 is a block diagram showing an example of the structure for arecording process for the system area according to the embodiment of thepresent invention.

FIG. 24 is a block diagram showing an example of the structure for aprocess for data reproduced from the system area according to theembodiment of the present invention.

FIG. 25 is a flow chart for explaining the reproducing process shown inFIG. 24.

FIG. 26 is a schematic diagram for explaining a problem solved by thepresent invention.

BEST MODES FOR CARRYING OUT THE INVENTION

Next, an embodiment of the present invention will be described. Theembodiment is applied to a digital VTR. The embodiment is suitable forthe environment of a broadcasting station.

According to the embodiment, for example MPEG2 is used as a compressionformation. The MPEG2 is a combination of a motion compensationpredictive encoding and a compression encoding using DCT. MPEG2 data ishierarchically structured. As shown in FIG. 1, MPEG2 data is composed ofa macro block layer (FIG. 1E) as the lowest layer, a slice layer (FIG.1D), a picture layer (FIG. 1C), a GOP layer (FIG. 1B), and a sequencelayer (FIG. 1A) as the highest layer.

As shown in FIG. 1E, the macro block layer is composed of DCT blockseach of which is a data unit for DCT. The macro block layer is composedof a macro block header and a plurality of DCT blocks. As shown in FIG.1D, the slice layer is composed of a slice header portion and at leastone macro block. As shown in FIG. 1C, the picture layer is composed of apicture header portion and at least one slice. One picture correspondsto one screen. As shown in FIG. 1B, the GOP layer is composed of a GOPheader portion, an I picture, a P picture, and a B picture. The Ipicture is a picture that has been intra-frame encoded. The P and Bpictures are pictures that have been predictively encoded.

According to the encoding syntax of MPEG, one GOP contains at least oneI picture. However, one GOP may contain neither a P picture nor a Bpicture. As shown in FIG. 1A, the sequence layer, which is the highestlayer, is composed of a sequence header portion and a plurality of GOPs.In the MPEG format, a slice is one variable length code sequence. Thevariable length code sequence is a sequence of which the boundary ofdata cannot be detected unless variable length code is correctlydecoded.

At the beginning of each of the sequence layer, the GOP layer, thepicture layer, and the slice layer, a start code is placed. The startcode is a predetermined bit pattern composed of bytes. The start codediffers in each of the layers. Particularly, in the sequence layer, thestart code is referred to as sequence header code. In each of the otherlayers, the start code is just referred to as start code. Each startcode has a bit pattern of [00 00 01 xx] (hexadecimal notation). Thus,the bit pattern has four set of two digits. In addition, [xx] representsthat each layer has a unique bit pattern.

In other words, each of the start codes and the sequence header code iscomposed of four bytes (=32 bits). Corresponding to the value of thefourth byte, the type of information that follows is identified. Sinceeach of the start codes and the sequence header code is arranged inbytes, they can be acquired by matching a pattern of four bytes.

The high order four bits of one byte preceded by the start code is anidentifier the represents the content of an extension data area (thatwill be described later). Corresponding to the value of the identifier,the content of the extension data can be identified.

Each DCT block in the macro block layer or each DCT block in each macroblock does not have an identification code having a predetermined bitpattern arranged in bytes.

Next, the header portion of each layer will be described in detail. Inthe sequence layer shown in FIG. 1A, at the beginning, a header 2 isplaced. The header 2 is followed by a sequence extension 3 and extensionand user data 4. At the beginning of the sequence header 2, a sequenceheader code 1 is placed. Likewise, at the beginning of each of thesequence extension 3 and the user data 4, a predetermined start code(not shown) is placed. The area from the sequence header 2 to theextension and user data 4 is a header portion of the sequence layer.

FIG. 2 shows contents and assigned bits of the sequence header 2. Asshown in FIG. 2, the sequence header 2 contains sequence header code 1,encoded picture size (composed of the number of pixels in horizontaldirection and the number of lines in vertical direction), aspect ratio,frame rate, bit rate, VBV (Video Buffering Verifier) buffer size, andquantizing matrix that are designated for each sequence with thedesignated numbers of bits.

As shown in FIG. 3, the sequence extension 3 preceded by the extensionstart code preceded by the sequence header designates additional dataused in MPEG2. The addition data is for example profile, level, chroma(color difference) format, and progressive sequence. As shown in FIG. 4,the extension and user data 4 contains sequence indication ( ) andsequence scalable extension ( ). The sequence indication ( ) containsinformation of RGB conversion characteristic of an original signal anddisplay screen size. The sequence scalable extension ( ) designates ascalability mode and the layer of scalability.

The header portion of the sequence layer is followed by GOPs. As shownin FIG. 1B, at the beginning of each GOP, GOP header 6 and user data 7are placed. The GOP header 6 and the user data 7 are a header portion ofeach GOP. As shown in FIG. 5, the GOP header 6 contains start code 5,time code, and flags representing independency and validity of the GOPwith the designated numbers of bits. As shown in FIG. 6, the user data 7contains extension data and user data. At the beginning of each of theextension data and the user data, predetermined start code (not shown)is placed.

The header portion of the GOP layer is followed by pictures. As shown inFIG. 1C, at the beginning of each picture, picture header 9, pictureencoding extension 10, and extension and user data 11 are placed. At thebeginning of the picture header 9, picture start code 8 is placed. Atthe beginning of each of the picture encoding extension 10 and theextension and user data 11, a predetermined start code is placed. Thearea from the picture header 9 to the user data 11 is a header portionof each picture.

As shown in FIG. 7, the picture header 9 contains picture start code 8.In addition, in the picture header 9, encoding condition for a screen isdesignated. As shown in FIG. 8, in the picture encoding extension 10,the range of a moving vector in the forward, backward, andhorizontal/vertical directions is designated. In addition, the picturestructure is designated. In the picture encoding extension 10, theaccuracy of DC coefficients of an intra-macro block is designated; theVLC type is selected; the linear/non-linear quantizing scale isselected; and the scanning method in DCT is selected.

As shown in FIG. 9, in the extension and user data 11, quantizingmatrix, spatial scalable parameter, and so forth are designated.According to the encoding syntax of MPEG, they can be designated foreach picture. Thus, a picture can be encoded corresponding tocharacteristics of each screen. Moreover, in the extension and user data11, the picture display area can be designated. Furthermore, in theextension and user data 11, copyright information can be designated.

The header portion of the picture layer is followed by slices. As shownin FIG. 1D, at the beginning of each slice, slice header 13 is placed.At the beginning of the slice header 13, slice start code 12 is placed.As shown in FIG. 10, the slice start code 12 includes positioninformation in the vertical direction of the current slice. In addition,the slice header 13 contains extended slice vertical positioninformation, quantizing scale information, and so forth.

The header portion of the slice layer is followed by macro blocks (seeFIG. 1E). Each macro block contains a macro block header 14 and aplurality of DCT blocks. As was described above, the macro block headerdoes not contain a start code. As shown in FIG. 11, the macro blockheader 14 contains relative position information of the current macroblock. In addition, in the macro block header 14, motion compensationmode and detail information about DCT encoding are designated.

The macro block header 14 is followed by DCT blocks. As shown in FIG.12, each DCT block contains variable-length code encoded DCTcoefficients and data about DCT coefficients.

In FIG. 1, solid line partitions of each layer represent that data isarranged in bytes, whereas dotted line partitions thereof represent thatdata is not arranged in bytes. In other words, as shown in FIG. 13A, inhigher layers up to the picture layer, the boundary of code is delimitedin bytes. On the other hand, in the slice layer, only the slice startcode 12 is delimited in bytes. As shown in FIG. 13B, each macro blockcan be delimited in bits. Likewise, in the macro block layer, each DCTblock can be delimited in bits.

The data structure described with reference to FIGS. 1 to 13 is aconventional MPEG data structure. According to the embodiment, to allowencoded data to be edited for each frame, all frames are intra-encoded.In addition, one GOP is composed of one I picture. Moreover, one sliceis composed of one macro block. In such an MPEG bit stream, each item(flag) of the above-described header portion may be a fixed value.

According to the encoding syntax of MPEG, the values of the header ofthe sequence layer and the header of the picture layer can be designatedfor each picture. However, according to the embodiment, to securelydecode a reproduced picture in the high speed reproducing operation, thevalues of the header of the sequence layer and the header of the picturelayer are the same in each frame. In reality, the MPEG encoder performssuch an encoding process.

FIG. 14 shows the headers of an MPEG stream according to the embodimentin reality. As is clear from FIG. 1, at the beginnings of the sequencelayer, the GOP layer, the picture layer, the slice layer, and the macroblock layer, the headers are placed. FIG. 14 shows an example of a dataarrangement starting with the sequence header portion.

At the beginning, sequence header 2 having the length of 12 bytes isplaced. The sequence header 2 is followed by sequence extension 3 havingthe length of 10 bytes. The sequence extension 3 is followed byextension and user data 4. At the beginning of the extension and userdata 4, user data start code having the length of four bytes is placed.The user data start code is followed by user data area. The user dataarea contains information corresponding to SMPTE standard.

The header portion of the sequence layer is followed by a header portionof the GPO layer. The header portion contains GPO header 6 having thelength of eight bytes. The GOP header 6 is followed by extension anduser data 7. At the beginning of the extension and user data 7, userdata start code having the length of four bytes is placed. The user datastart code is followed by user data area. The user data area containsinformation necessary for having compatibility with another conventionalvideo format.

The header portion of the GOP layer is followed by header portion of thepicture layer. The picture portion contains picture header 9 having thelength of nine bytes. The picture header 9 is followed by pictureencoding extension 10 having the length of nine bytes. The pictureencoding extension 10 is followed by extension and user data 11. Thefirst 133 bytes of the extension and user data 11 is extension and userdata. The extension and user data is followed by user data start code 15having the length of four bytes. The user data start code 15 is followedby information necessary for having compatibility with anotherconventional video format. The information is followed by user datastart code 16. The user data start code 16 is followed by datacorresponding to SMPTE standard. The header portion of the picture layeris followed by slices.

Next, a macro block will be further described. Each macro blockcontained in the slice layer is a set of a plurality of DCT blocks. Anencoded sequence of DCT blocks is composed of sets of runs and levels. Arun represents the number of 0's as a quantized DCT coefficient. A levelis immediately preceded by a run. A level represents a non-zero value asa quantized DCT coefficient. Neither each macro block nor each DCT blockcontained in each macro block does not contain identification codearranged in bytes.

A macro block is formed by dividing one screen (picture) into a latticeof 16 pixels×16 lines. A slice is formed by connecting macro blocks forexample in the horizontal direction. The last macro block of one sliceis continued to the first macro block of the next slice. Macro blocksbetween two slices are prohibited from being overlapped. The number ofmacro blocks per one screen depends on the size thereof.

The number of macro blocks in the vertical direction of a screen isreferred to as mb_height, whereas the number of macro blocks in thehorizontal direction of a screen is referred to as mb_width. Thecoordinates of a macro block are defined as mb_height and mb_column.mb_height is the vertical position number of the current macro blockcounted from the upper edge of the screen, the upper edge being 0.mb_column is the horizontal position number of the current macro blockcounted from the left edge of the screen, the left edge being 0. Theposition of a macro block on the screen is represented with one variableas macroblock_address=mb_row×mb_width+mb_column.

The order of slices and macro blocks of a stream is defined withmacroblock_address. In other words, a stream is transmitted in thedownward direction and leftward direction of the screen.

In the MPEG, normally, one slice is composed of one stripe (16 lines).The variable length encoding starts at the left edge of the screen andends at the right edge of the screen. Thus, when a VTR has recorded anMPEG elementary stream, if it is reproduced at high speed, the VTRmainly reproduces the left edge of the screen. Thus, the screen cannotbe equally updated. In addition, since the position on the tape cannotbe predicted, if a tape pattern is traced at predetermined intervals,the screen cannot be equally updated. Moreover, if at least one errortakes place, it adversely affects until the right edge of the screen.Thus, until the next slice header is detected, the error continues.Consequently, one slice is composed of one macro block.

FIG. 15 shows an example of the structure of the record side of arecording and reproducing apparatus according to the embodiment of thepresent invention. When the recording operation is performed, a digitalsignal is input from a terminal 100. The digital signal is supplied toan SDI (Serial Data Interface) receiving portion 101. The SDI is aninterface defined by SMPTE so that a component video signal, a digitalaudio signal, and additional data can be transmitted. The SDI receivingportion 101 extracts a digital video signal and a digital audio signalfrom the input digital signal. The digital video signal is supplied to aMPEG encoder 102. The digital audio signal is supplied to an ECC encoder109 through a delay 103. The delay 103 absorbs the time differencebetween the digital audio signal and the digital video signal.

In addition, the SDI receiving portion 101 extracts a synchronous signalfrom the input digital signal. The extracted synchronous signal issupplied to a timing generator 104. Alternatively, an externalsynchronous signal may be input from a terminal 105 to the timinggenerator 104. The timing generator 104 generates timing pulsescorresponding to a designated signal of the input synchronous signal anda synchronous signal supplied from a SDTI receiving portion 108 (thatwill be described later). The generated timing pulses are supplied toeach portion of the recording and reproducing apparatus.

The MPEG encoder 102 performs a DCT (Discrete Cosine Transform) processfor the input video signal so as to transform the input video signalinto coefficient data and then encode the coefficient data withvariable-length code. The variable-length code encoded data (VLC) datais an elementary stream (ES) corresponding to the MPEG2. The output issupplied to one of input terminals of a record side multiformatconverter (referred to as MFC) 106.

On the other hand, data in SDTI (Serial_Data Transport Interface) formatis input from an input terminal 107. The signal is synchronouslydetected by an SDTI receiving portion 108. Thereafter, the signal istemporarily stored in a buffer. Thereafter, the elementary stream isextracted from the buffer. The extracted elementary stream is suppliedto another input terminal of the record side MFC 106. The synchronoussignal that has been synchronously detected is supplied to theabove-described timing generator 104.

According to the embodiment, to transmit an MPEG ES (MPEG elementarystream), for example SDTI (Serial Data Transport Interface)-CP (ContentPackage) is used. The ES is 4:2:2 components. In addition, the ES is astream composed of only I pictures. Moreover, the ES has the relation of1 GOP=1 picture. In the SDTI-CP format, the MPEG ES is separated intoaccess units and packed to packets corresponding to frames. In theSDTI-CP format, a sufficient transmission band (27 MHz or 36 MHz ofclock rate or 270 Mbps or 360 Mbps of stream bit rate. Thus, in oneframe period, the ES can be transmitted as a burst.

In the area after SAV until EAV of one frame period, system data, videostream, audio stream, and AUX data are placed. Data is not equallyplaced in the entire frame period. Instead, in a predetermined periodfrom the beginning, data is placed as a burst. At the boundary of aframe, an SDTI-CP stream (video and audio) can be switched in the formof a stream. In the SDTI-CP format, when contents use SMPTE time codecorresponding to the clock, audio is synchronized with video. Inaddition, it is defined that SDTI-CP and SDI coexist.

As in the case that a TS (Transport Stream) is transferred, theabove-described interface corresponding to the SDTI-CP format does notneed to cause an SDTI-CP steam to flow to a VBV (Video Buffer Verifier)buffer and TBs (Transport Buffers) of the encoder and the decoder. Thus,the delay of the stream can be decreased. In addition, since the SDTI-CPformat allows a stream to be transferred at very high rate, the delaycan be further decreased. Thus, in an environment of which there is asynchronization in the entire broadcasting station, the SDTI-CP formatcan be effectively used.

The SDTI receiving portion 108 further extracts a digital audio signalfrom the input SDTI-CP stream. The extracted digital audio signal issupplied to the ECC encoder 109.

The record side MFC 106 contains a selector and a stream converter. Therecord side MFC 106 is disposed in for example one integrated circuit.Next, the process performed by the record side MFC 106 will bedescribed. An MPEG ES supplied from the MPEG encoder 102 or an MPEG ESsupplied from the SDTI receiving portion 108 is selected by theselector. The selected MPEG stream is processed by the record side MFC106.

The record side MFC 106 rearranges DCT coefficients of individual DCTblocks of one macro block arranged corresponding to the MPEG2 standardto DCT coefficients over all DCT blocks corresponding to frequencycomponents. In addition, when one slice of an elementary stream iscomposed of one stripe, the record side MFC 106 converts the elementarystream so that one slice is composed of one macro block. Moreover, therecord side MFC 106 limits the maximum length of the variable lengthdata that takes place in one macro block to a predetermined length. Thisprocess is performed by designating 0 to high order DCT coefficients.Moreover, the record side MFC 106 performs an interpolating process forthe header of the sequence layer and the quantizing matrix for eachpicture of the MPEG bit stream. The converted elementary streamrearranged by the record side MFC 106 is supplied to the ECC encoder109.

A main memory having a large storage capacity (not shown) is connectedto the ECC encoder 109. The ECC encoder 109 comprises a packing andshuffling portion, an audio outer code encoder, a video outer codeencoder, a video inner code encoder, an audio shuffling portion, a videoshuffling portion, and so forth. The ECC encoder 109 comprises an IDadding circuit and a synchronous signal adding circuit. The ID addingcircuit adds an ID to each sync block. The ECC encoder 109 is composedof for example one integrated circuit.

According to the embodiment, error correction code used for video dataand audio data is product code of which the video data or audio data isencoded with outer code in the vertical direction of a two dimensionalarray and the video data or audio data is encoded with inner code in thehorizontal direction of the two dimensional array. Thus, with theproduct code, data symbols are dually encoded. As the outer code andinner code, Reed-Solomon code can be used.

Next, the process performed by the ECC encoder 109 will be described.Since video data of a converted elementary stream has been encoded withvariable length code, the data length of each macro block varies. Thepacking and shuffling portion packs each macro block in a fixed length.When a macro block cannot be packed in the fixed length, the overflowportion is packed to other areas that have spaces against the fixedlength.

In addition, system data containing information about picture format,version of shuffling pattern, and so forth is supplied from a systemcontroller 121 (that will be described later). The system data is inputfrom an input terminal (not shown). The system data is supplied to thepacking and shuffling portion. The packing and shuffling portionperforms a record process for the system data as with picture data. Thesystem data is recorded as video AUX. In addition, the packing andshuffling portion rearranges macro blocks of one frame that aregenerated in the scanning order and performs a shuffling process fordispersing the record positions of the macro blocks on the tape. Sincethe macro blocks are shuffled, even if data is partly reproduced when itis reproduced at high speed, the update ratio of the picture can beimproved.

The video data and system data supplied from the packing and shufflingportion (unless otherwise specified, even if video data contains systemdata, the video data is simply referred to as video data) is supplied tothe video outer code encoder that encodes video data with outer code.The video outer code encoder adds an outer code parity to the videodata. An output of the outer code encoder is supplied to the videoshuffling portion. The video shuffling portion performs a shufflingprocess for the output of the outer code encoder so as to change theorder of sync blocks over a plurality of ECC blocks. Since sync blocksare shuffled, an error can be prevented from concentrating on aparticular ECC block. The shuffling process performed by the shufflingportion may be referring to interleave. An output of the video shufflingportion is written to the main memory.

On the other hand, as was described above, a digital audio signal thatis output from the SDTI receiving portion 108 or the delay 103 issupplied to the ECC encoder 109. According to the embodiment,non-compressed digital audio signal is handled. Alternatively, thedigital audio signal may be input through an audio interface. Inaddition, audio AUX is supplied from an input terminal (not shown). Theaudio AUX is auxiliary data that contains information about audio datasuch as sampling frequency. The audio AUX is added to audio data andtreated in the same manner as audio data.

Audio data to which the audio AUX has been added (unless otherwisespecified, referred to as audio data) is supplied to the audio outercode encoder that encodes audio data with outer code. An output of theaudio outer code encoder is supplied to an audio shuffling portion. Theaudio shuffling portion shuffles the audio data. The audio shufflingportion shuffles the audio data for each sync block and for eachchannel.

An output of the audio shuffling portion is written to a main memory. Aswas described above, the output of the video shuffling portion is alsowritten to the main memory. The main memory mixes the audio data and thevideo data as data of one channel.

Data is read from the main memory. An ID that represents information ofa sync block number is added to the data. The resultant data is suppliedto the inner code encoder. The inner code encoder encodes the supplieddata with inner code. A synchronous signal is added to an output of theinner code encoder for each sync block. As a result, record data assuccessive sync blocks is formed.

Record data that is output from the ECC encoder 109 is supplied to anequalizer 110 that includes a recording amplifier and so forth. Theequalizer 110 converts the supplied data into a record RF signal. Therecord RF signal is supplied to a rotating drum 111 on which a rotatinghead is disposed at a predetermined position and then recorded on themagnetic tape 112. In reality, a plurality of magnetic heads aredisposed in such a manner that azimuths of heads that form adjacenttracks are different.

When necessary, a scrambling process may be performed for the recorddata. When digital data is recorded, it may be digitally modulated.Moreover, partial response class 4 and Viterbi encoding may be used. Theequalizer 110 contains both the structure for the record side and thestructure for the reproduction side.

FIG. 16 shows a track format in the case that an interlaced video signalwhose frame frequency is 29.97 Hz and whose size is 720 pixels (thenumber of effective horizontal pixels)×480 lines (the number ofeffective lines) and PCM audio signals of four channels are recorded ona magnetic tape with a rotating head. In the example, video data andaudio data for one frame are recorded with four tracks. Two trackshaving different azimuths are paired. On each track, a record area foraudio data (namely, audio sector) is formed at a nearly center portion.A video record area (video sector) is formed on both sides of the audiosector.

In the example, audio data of four channels can be handled. A1 to A4represent channels 1 to 4 of audio data, respectively. Audio data isrecorded in such a manner that the arrangement of audio data is changedin each set of two tracks having different azimuths. In the example,video data for four error correction blocks per track is interleaved.The interleaved data is divided into an upper side sector and a lowerside sector and recorded.

The lower side video sector has a system area (SYS) at a predeterminedposition. The system area is alternately formed on the beginning sideand the end side of the lower side video sector of each track.

In FIG. 16, SAT is an area in which a servo lock signal is recorded.Between each area, a gap having a predetermined size is formed.

In FIG. 16, data for each frame is recorded with four tracks. Dependingon the format of data that is recorded and reproduced, data for eachframe may be recorded with eight tracks per frame, six tracks per frame,and so forth.

As shown in FIG. 16B, data recorded on the tape is composed of aplurality of blocks formed at equal intervals. These blocks are referredto as sync blocks. FIG. 16C shows an outline of the structure of a syncblock. A sync block is composed of sync pattern, ID, DID, data packet,and error correction inner code parity. The SYNC pattern is used todetect synchronization. The ID is used to identify the current syncblock. The DID is used to represent the content of data that follows.Data is treated as packets corresponding to sync blocks. In other words,the minimum unit of data that is recorded or reproduced is one syncblock. Many sync blocks (see FIG. 16B) compose for example a videosector.

As shown in FIG. 16A, the system area is separated from the video data.When the rotating head reproduces a plurality of tracks at a time in thehigh speed reproducing operation, the system area can be almost securelyreproduced. The high speed reproducing operation is an operation whosetape speed is for example twice or more higher than the tape speed ofthe recording operation.

In the system area, data for one sync block as shown in FIG. 16D isrecorded. The minimum data length is 109 bytes. The rest of the systemarea contains dummy data. The data of 109 bytes is composed of systemdata of 5 bytes, header data (Mpeg) of 2 bytes, picture information(Picture Info) of 10 bytes, and user data of 92 bytes. The system datacontains edit point information, picture format information such as linefrequency, frame frequency, and aspect ratio, information representingproperness of recorded MPEG elementary stream against syntax,information representing shuffling method, and so forth.

As header data, at least part of information contained in the header ofthe sequence layer and the header of the sequence layer is recorded.Although the format of the bit stream that is recorded should satisfythe encoding syntax of MPEG, as a required condition, data necessary fordecoding the bit stream or data for creating the header of the sequencelayer or the header of the picture layer can be recorded as header dataof the system area. Thus, it is not required that header data recordedin the system area satisfy the encoding syntax of MPEG. According to theembodiment, since all frames are intra-encoded, one GOP is composed ofone I picture, and one slice is one macro block, information of theheader portion is fixed. Thus, it is not necessary to record suchinformation.

As picture information (Picture Info) of the system area, encodinginformation of the encoder of another digital VTR is recorded. As userdata, serial number, model name, record year-month-day, and so forth ofthe digital VTR are recorded.

According to the embodiment, as was described above, to securely obtaina decoded picture in the high speed reproducing operation, twocountermeasures—one for causing the header of the sequence layer to bethe same as the header of the picture layer in all frames and the otherfor causing the header information to be recorded to the system area—areperformed. However, it is not necessary to perform both the methodstogether. Instead, with only one method, a picture can be effectivelydecoded in the high speed reproducing operation. For example, as long asheader data of the stream can be securely reproduced in the high speedreproducing operation because of a particular packing method differentfrom that of the embodiment, with only a countermeasure for causing theinformation of the headers of all frames to be the same can beperformed.

Returning to the description of FIG. 15, when a signal is reproducedfrom the magnetic tape 112, the signal reproduced from a magnetic tape112 by the rotating drum 111 is supplied to a reproduction sidestructure of the equalizer 110 that includes a reproducing amplifier.The equalizer 110 performs an equalizing process, a waveform trimmingprocess, and so forth for the reproduced signal. When necessary, theequalizer 110 performs a demodulating process, a Viterbi decodingprocess, and so forth for the reproduced signal. An output of theequalizer 110 is supplied to an ECC decoder 113.

The ECC decoder 113 performs the reverse process of the ECC encoder 109.The ECC decoder 113 comprises a main memory, an inner code decoder, anaudio deshuffling portion, a video deshuffling portion, and an outercode decoder. The main memory has a large storage capacity. The ECCdecoder 113 comprises a video deshuffling and depacking portion and avideo data interpolating portion. Likewise, the ECC decoder 113comprises an audio AUX separating portion and an audio datainterpolating portion. The ECC decoder 113 is composed of for exampleone integrated circuit.

Next, the process performed by the ECC decoder 113 will be described.The ECC decoder 113 detects synchronization. In other words, the ECCdecoder 113 detects a synchronous signal added at the beginning of async block and extracts a sync block. Each sync block of thereproduction data is supplied to the inner code decoder. The inner codedecoder corrects an error of a sync block with inner code. For an outputof the inner code decoder, an ID interpolating process is performed. TheID (for example, the sync block number) of a sync block from which anerror is detected with inner code is interpolated. The resultantreproduced data is separated into video data and audio data.

As was described above, the video data represents both DCT coefficientdata generated in the MPEG intra-encoding process and system data.Likewise, the audio data represents PCM (Pulse Code Modulation) data andaudio AUX.

The separated audio data is supplied to the audio deshuffling portion.The audio deshuffling portion performs the reverse process of theshuffling process performed by the record side shuffling portion. Anoutput of the deshuffling portion is supplied to the audio outer codedecoder. The outer code decoder corrects an error of the audio data withouter code. The audio outer code decoder outputs error-corrected audiodata. When an error of audio data cannot be corrected, an error flag isset.

An output of the audio outer code decoder is supplied to the audio AUXseparating portion. The audio AUX separating portion separates audio AUXfrom the audio data that is output from the audio outer code decoder.The separated audio AUX is output from the ECC decoder 113 (the route isnot shown). The audio AUX is supplied to the data interpolating portion.The data interpolating portion interpolates a sample containing anerror. The interpolating method is for example average valueinterpolating method, preceding value hold method, or the like. In theaverage value interpolating method, a sample containing an error isinterpolated with an earlier correct sample and a later correct sample.In the preceding value hold method, a preceding correct value is held.

An output of the data interpolating portion is an output of audio datathat is output from the ECC decoder 113. The audio data that is outputfrom the ECC decoder 113 is supplied to a delay 117 and an SDTI outputportion 115. The delay 117 absorbs the delay in the process for videodata performed in an MPEG decoder 116. The delay 117 delays the audiodata by a predetermined time period and supplies the delayed audio datato an SDI output portion 118.

The separated video data is supplied to the deshuffling portion. Thedeshuffling portion performs the reverse process of the shufflingprocess performed by the record side shuffling portion. The deshufflingportion restores the sync blocks shuffled by the record side shufflingportion to the original sync blocks. An output of the deshufflingportion is supplied to the outer code decoder. The outer code decodercorrects an error of each sync block with outer code. When anuncorrectable error takes place, an error flag that represents thatthere is an error is set.

An output of the outer code decoder is supplied to the deshuffling anddepacking portion. The deshuffling and depacking portion restores macroblocks shuffled by the record side packing and shuffling portion to theoriginal macro blocks. In addition, the deshuffling portion anddepacking portion depacks packed macro blocks. In other words, thedeshuffling portion and depacking portion restores fixed length code ofeach macro block to the original variable length code. In addition, thedeshuffling and depacking portion separates the system data from thevideo data. The system data is output from the ECC decoder 113 andsupplied to a system controller 121.

An output of the deshuffling and depacking portion is supplied to thedata interpolating portion. The data interpolating portion corrects datato which an error flag has been set (namely, data having an error). Inother words, before the conversion is performed, if macro block data hasan error, DCT coefficients of frequency components after the position ofthe error cannot be corrected. In such a case, for example, data at theposition of the error is substituted with block end code (EOB) so thatDCT coefficients of the subsequent frequency components become zero.Likewise, when video data is reproduced at high speed, only DCTcoefficients corresponding to the sync block length are restored. Theother coefficients are substituted with zero data. In addition, the datainterpolating portion performs a header recovering process for a headerat the beginning of video data (sequence header, GOP header, pictureheader, user data, and so forth) when the header has an error.

Since DCT coefficients are arranged from DC components to higherfrequency components over all DCT blocks, even if DCT coefficients aftera particular point are omitted, DC components and lower frequencycomponents can be equally placed in individual DCT blocks that compose amacro block.

Video data that is output from the data interpolating portion of the ECCdecoder 113 is supplied as an output of the ECC decoder 113. The outputsof the ECC decoder 113 are supplied to a reproduction side multi-formatconverter (hereinafter abbreviated to reproduction side MFC) 114. Thereproduction side MFC 114 performs the reverse process of theabove-described record side MFC 106. The reception side MFC 114 includesa stream converter. The reception side MFC 114 is composed of forexample one integrated circuit.

The stream converter performs the reverse process of the record sidestream converter. In other words, the stream converter rearranges DCTcoefficients arranged over a plurality of DCT blocks corresponding tofrequency components to DCT coefficients in each DCT block. Thus, thereproduced signal is converted into an MPEG2 elementary stream.

On the other hand, as with the record side, the input and output of thestream converter should have a sufficient transmission rate (band width)corresponding to the maximum length of macro blocks. When the length ofeach macro block (slice) is not limited, it is preferred to secure theband width three time larger than the pixel rate.

An output of the stream converter of the reception side MFC 114 is anoutput of the reception side MFC 114. The output of the reception sideMFC 114 is supplied to the SDTI output portion 115 and the MPEG decoder116.

The MPEG decoder 116 decodes the elementary stream and outputs videodata. The elementary stream is supplied to the MPEG decoder 116. TheMPEG decoder 116 performs a pattern matching for the elementary streamand detects sequence header code and start code therefrom. Correspondingto the detected sequence header code and start code, the MPEG decoder116 extract encoding parameters contained in the header portion of eachlayer. Corresponding to the extracted encoding parameters, the MPEGdecoder 116 performs an inverse quantizing process and an inverse DCTprocess for the elementary stream.

The decoded video data that is output from the MPEG decoder 116 issupplied to the SDI output portion 118. As described above, the audiodata that has been separated from the video data by the ECC decoder 113is supplied to the SDI output portion 118 through the delay 117. The SDIoutput portion 118 maps the supplied video data and audio data in theSDI format and outputs a stream having the data structure of the SDIformat. The stream is output from the SDI output portion 118 to theoutside through an output terminal 120.

On the other hand, the audio data separated from the video data by theECC decoder 113 is supplied to the SDTI output portion 115. The SDTIoutput portion 115 maps the video data and audio data to the SDTI formatso as to converts them to a stream having a data structure of the SDTIformat. The converted stream is output to the outside through an outputterminal 119.

When an external device to which an SDTI stream has been supplied fromthe output terminal 119 needs to perform an MPEG decoding process, theexternal device performs a pattern matching for the supplied stream,detects sequence start code and start code, and extracts encodingparameters of the header portion of each layer. Corresponding to theextracted encoding parameters, the external device decodes the suppliedSDTI stream.

In FIG. 15, the system controller 121 is composed of for example a microcomputer. The system controller 121 controls the entire operations ofthe recording and reproducing apparatus. A servo 122 communicates withthe system controller 121 so as to control the traveling of the magnetictape 112 and the driving of the rotating drum 111.

FIG. 17A shows the order of DCT coefficients of video data that isoutput from the DCT circuit of the MPEG encoder 102. This order appliesto an MPEG ES that is output from the SDTI receiving portion 108. In thefollowing description, an output of the MPEG encoder 102 will bedescribed as an example. DCT coefficients are zigzag-scanned and outputstarting from the upper left DC component of the DCT block in thedirections of which horizontal and vertical spatial frequencies becomehigh. Thus, as shown in FIG. 17B, a total of 64 (8 pixels×8 lines) DCTcoefficients are arranged in the order of frequency components.

The DCT coefficients are variable-length encoded by the VLC portion ofthe MPEG encoder. In other words, the first coefficient is fixed as a DCcomponent. The next components (AC components) are assigned codecorresponding to sets of runs of zeros and levels. Thus, the variablelength code encoded output of coefficient data of AC components is asequence of AC₁, AC₂, AC₃, . . . and so forth in the order from lowerfrequency (low order) components to higher frequency (high order)components. The elementary stream contains variable length code encodedDCT coefficients.

The record side stream converter that is built in the record side MFC106 rearranges DCT coefficients of the supplied signal. In other words,the DCT coefficients arranged in the order of frequency components ineach DCT block by the zigzag scanning are rearranged in the order offrequency components over all DCT blocks that composes the macro block.

FIG. 18 shows an outline of the rearrangement of DCT coefficientsperformed by the record side stream converter. In the case of a (4:2:2)component signal, one macro block is composed of four DCT blocks (Y₁,Y₂, Y₃, and Y₄) of the luminance signal Y, two DCT blocks (Cb₁, and Cb₂)of the color difference signal Cb, and two DCT blocks (Cr₁, and Cr₂) ofthe color difference signal Cr.

As was described above, the MPEG encoder 102 zigzag-scans DCTcoefficients corresponding to the MPEG2 standard. As shown in FIG. 18A,DCT coefficients are arranged in the order of a DC component and ACcomponents from the lowest frequency component to the highest frequencycomponent for each DCT block. After one DCT block has beenzigzag-scanned, the next DCT block is zigzag-scanned. Likewise, DCTcoefficients are arranged.

In other words, in a macro block, in each of the DCT blocks Y₁, Y₂, Y₃,and Y₄ and the DCT blocks Cb₁, Cb₂, Cr₁, and Cr₂, DCT coefficients arearranged in the order of a DC component and AC components from thelowest frequency component to the highest frequency component. Variablelength code encoding is performed in such a manner that sets of runs andlevels are assigned code such as [DC, AC₁, AC₂, AC₃, . . . ].

The record side stream converter interprets the DCT coefficients encodedwith variable length code, detects the delimitation of each coefficient,and arranges DCT coefficients over all DCT blocks of the macro blockcorresponding to frequency components. FIG. 18B shows such a process.Firstly, the stream converter arranges DC components over eight DCTblocks of the macro blocks. Thereafter, the stream converter arrangesthe lowest frequency AC components over the eight DCT blocks. Likewise,the stream converter arranges AC coefficient data over the eight DCTblocks corresponding to each order component.

The coefficient data is rearranged in the order of DC (Y₁), DC (Y₂), DC(Y₃), DC (Y₄), DC (Cb₁), DC (Cr₁), DC (Cb₂), DC (Cr₂), AC₁ (Y₁), AC₁(Y₂), AC₁ (Y₃), AC₁ (Y₄), AC₁ (Cb₁), AC₁ (Cr₁), AC₁ (Cb₂), AC₁ (Cr₂), .. . and so forth. As was described with reference to FIG. 17, DC, AC₁,AC₂, . . . , and so forth are variable length code assigned to sets ofruns and levels.

The converted elementary stream of which the order of coefficient datahas been changed by the record side stream converter is supplied to thepacking and shuffling portion of the ECC encoder 109. The data length ofeach macro block of the converted elementary stream is the same as thedata length of each macro block of non-converted elementary stream. Inaddition, although the MPEG encoder 102 fixes the length of each GOP(one frame) by the bit rate control, the length of each macro blockvaries. The packing and deshuffling portion packs data of the macroblock to a fixed length.

FIG. 19 shows an outlines of a packing process for macro blocksperformed by the packing and shuffling portion. Macro blocks are packedto a predetermined fixed length. The fixed length corresponds to thedata length of a sync block that is the minimum unit of data that isrecorded and reproduced. Thus, the shuffling and error correction codeencoding process can be easily performed. For simplicity, in FIG. 19, itis assumed that one frame contains eight macro blocks.

As shown in FIG. 19A, since the variable length encoding process-isperformed for eight macro blocks, their lengths are different eachother. In this example, the length of each of macro blocks #1, #3, and#6 is larger than the fixed length as the length of the data area of onesync block. The length of each of macro blocks #2, #5, #7, and #8 issmaller than the fixed length. The length of macro block #4 is almostequal to the length of one sync block.

The packing process packs a macro block to the fixed length of thelength of one sync block. This is because the amount of data generatedin one frame period is fixed. As shown in FIG. 19B, when the length of amacro block is longer than the length of one sync block, the macro blockis divided at the position of the length of one sync block. The portionthat exceeds the length of one sync block (namely, overflow portion) issuccessively packed to macro blocks each of which does not exceed thelength of one sync block in such a manner that the overflow portion ispreceded by those macro blocks.

In the example shown in FIG. 19B, in the macro block #1, the portionthat exceeds the length of one sync block is packed after the macroblock #2. When the length of the resultant macro block #2 becomes thesame as the length of one sync block, the remaining portion is packedafter the macro block #5. Next, in the macro block #3, the portion thatexceeds the length of one sync block is packed after the macro block #7.Thereafter, in the macro block #6, the portion that exceeds the lengthof one sync block is packed after the macro block #7. The remainingportion is packed after the macro block #8. In such a manner, each macroblock is packed to the fixed length as the length of one sync block.

The record side stream converter can predetermine the length of variablelength data of each macro block in advance. Thus, the packing portioncan know the end of data of each macro block without need to decode VLCdata and check the content.

FIG. 20 shows the packing process for data for one frame in more detail.In the shuffling process, macro blocks MB1, MB2, MB3, MB4, . . .dispersed on the screen as shown in FIG. 20A are successively arrangedas shown in FIG. 25B. The header of the sequence layer and the header ofthe picture layer are added to each frame. The header portion composedof such headers is treated as a top macro block and packed. As shown inFIG. 20C, the overflow portion that extrudes from the fixed length (syncblock length) is packed to areas that have a space. In FIG. 25B, theoverflow portions are denoted by 300, 301, and 302. The packed data insuch a manner is recorded on the magnetic tape 112 as shown in FIG. 20D.

In the high speed reproducing operation of which a magnetic tape istraveled at a higher speed than the recording operation, the rotatinghead traces a plurality of tracks at a time. Thus, the reproduced datacontains data of different frames. When the reproducing operation isperformed, the depacking process is performed in the reverse manner asthe packing process. When the depacking process is performed, all datafor one frame should have been arranged. When data of a plurality offrames is mixed as in the high speed reproducing mode, the depackingprocess cannot be performed. Thus, in the high speed reproducingoperation, only data that does not protrude from the fixed length isused rather than overflow data.

Thus, since the data length of the header portion is larger than thesync block length, as shown in FIG. 20B, data 300 that protrudes fromthe fixed length cannot be used in the high speed reproducing operation.Thus, the data of the header portion cannot be fully reproduced.However, according to the embodiment, since the system area containsinformation necessary for the decoding process and the rotating headalmost securely traces the system area in the high speed reproducingoperation, pictures can be decoded in the high speed reproducing mode.

FIG. 21 shows a more practical structure of the above-described ECCencoder 109. In FIG. 21, reference numeral 164 is an interface for anexternal main memory 160 connected to the IC. The main memory 160 iscomposed of an SD RAM. The interface 164 arbitrates a request from theECC encoder 109 to the main memory 160 and performs a read/write processfrom and to the main memory 160. In addition, a packing portion 137 a, avideo shuffling portion 137 b, and a packing portion 137 c compose apacking and shuffling portion.

FIG. 22 shows an example of the address structure of the main memory160. The main memory 160 is composed of for example a 64-Mbit SDRAM. Themain memory 160 comprises a video area 250, an overflow area 251, and anaudio area 252. The video area 250 is composed of four banks (vbank #0,vbank #1, vbank #2, and vbank #3). Each of the four banks can store adigital video signal for one fixed length unit. One fixed length unit isa unit of which the amount of generated data is controlled to an almosttarget value. One equal length unit is for example one picture (Ipicture) of a video signal. In FIG. 22, portion A represents a dataportion of one sync block of a video signal. One sync block containsdata of bytes that depend on the format that is used. To deal with aplurality of formats, the data size of one sync block is larger than themaximum number of bytes of sync blocks of individual formats. Forexample, the number of bytes of one sync block is 256 bytes.

Each bank of the video area is divided into a packing area 250A and aninner code encoder output area 250B. The overflow area 251 is composedof four banks corresponding to the above-described video area. The mainmemory 160 has an audio data processing area 252.

According to the embodiment, with reference to a data length sign ofeach macro block, the packing portion 137 a stores the fixed length dataand overflow data that exceeds the fixed length to different areas ofthe main memory 160. The fixed length data is data that does not exceedthe length of the data area of a sync block. Hereinafter, the fixedlength data is referred to as block length data. The block length datais stored in the packing area 250A of each bank. When the length of amacro block is smaller than the block length, the corresponding area ofthe main memory 160 has a blank region. The video shuffling portion 137b controls the write addresses so as to shuffle macro blocks. The videoshuffling portion 137 b shuffles only block length data rather thanoverflow portions. The overflow portions are written to an area assignedto the overflow data.

Next, the packing portion 137 c packs overflow portions to a memory ofan outer code encoder 139. In other words, the packing portion 137 creads data having the block length from the main memory 160 to a memoryfor one ECC block of the outer code encoder 139. When the block lengthdata has a blank region, the packing portion 137 c packs the overflowportion to the block length data having the blank region. After thepacking portion 137 c has read data for one ECC block, it temporarilystops reading data. The outer code encoder 139 generates an outer codeparity. The outer code parity is stored to the memory of the outer codeencoder 139. After the outer code encoder 139 has completed the processfor one ECC block, data and outer code parities that are output from theouter code encoder 139 are rearranged in the order of the inner codeencoding. The resultant data is written again to an output area 250Bthat is different from the packing process area 250A of the main memory160. A video shuffling portion 140 controls the addresses of the mainmemory 160 at which data that has been encoded with outer code iswritten so as to shuffle sync blocks.

In such a manner, block length data and overflow data are separated. Theblock length data is written to the first area 250A (as first packingprocess). The overflow data is packed to the memory of the outer codeencoder 139 (as second packing process). The outer code parity isgenerated. The data and outer code parity are written to the second area250B of the main memory 160. Those processes are performed for each ECCblock. Since the outer code encoder 139 has a memory having the size ofone ECC block, the access frequency against the main memory 160 can bedecreased.

After a predetermined number of ECC blocks contained in one picture (forexample, 32 ECC blocks) have been processed, the packing process and theouter code encoding process for one picture are completed. Data that isread from the area 250B of the main memory 160 is processed by an IDadding portion 148, an inner code encoder 147, and a synchronizationadding portion 150. A parallel-serial converting portion 124 convertsoutput data of the synchronization adding portion 150 into bit serialdata. The output serial data is processed by a partial response class 4precoder 125. When necessary, the output is digitally modulated. Theresultant data is supplied to a rotating head disposed on the rotatingdrum 111.

A sync block that does not have valid data (this sync block is referredto as null sync) is placed in an ECC block so that ECC blocks can becomeflexible against the difference of formats of record video signals. Anull sync is generated by the packing portion 137 a of the packing andshuffling portion 137. The generated null sync is written to the mainmemory 160. Thus, since the null sync has a data record area, it can beused as a record sync for an overflow portion.

In the case of audio data, even number samples and odd number samples ofaudio data of one field form different ECC blocks. Since an ECC outercode sequence is composed of audio samples in the input order, wheneveran audio sample of an outer code sequence is input, an outer codeencoder 136 generates an outer code parity. A shuffling portion 147controls the addresses of the audio data processing area 252 of the mainmemory 160 against an output of the outer code encoder 136 so as toshuffle it (in each channel and in each sync block).

In addition, a CPU interface 126 is disposed. The CPU interface 126receives data from an external CPU 127 that functions as a systemcontroller and designates parameters for the internal blocks. To handlea plurality of formats, the CPU interface 126 can designate manyparameters such as sync block length, parity length.

“Packing length data” as a parameter is sent to the packing portions 137a and 137 b. The packing portion 137 a and 137 b each pack VLC data inthe fixed length (that is a length represented as “payload length” shownin FIG. 19A) designated corresponding to the parameter “packing lengthdata”.

“Number of packs data” as a parameter is sent to the packing portion 137b. The packing portion 137 b designates the number of packs per syncblock corresponding to the parameter “number of packs data”. Data forthe designated number of packs is supplied to the outer code encoder139.

“Number of video outer code parities data” as a parameter is sent to theouter code encoder 139. The outer code encoder 139 encodes video datahaving parities corresponding to the parameter “number of video outercode parities data” with outer code.

“ID information” and “DID information” as parameters are sent to an IDadding portion 148. The ID adding portion 148 adds the ID informationand the DID information to a data sequence having a unit length that isread from the main memory 160.

“Number of video inner code parities data” and “number of audio innercode parities data” as parameters are sent to the inner code encoder149. The inner code encoder 149 encodes video data and audio data havingparities corresponding to the parameters “number of video inner codeparities data” and “number of audio inner code parities data” with innercode. In addition, “sync length data” as a parameter is sent to theinner code encoder 149. Thus, the unit length (sync length) of data thathas been encoded with inner code is limited.

In addition, shuffling table data as a parameter is stored to a videoshuffling table (RAM) 128 v and an audio shuffling table (RAM) 128 a.The shuffling table 128 v performs an address conversion for the videoshuffling portions 137 b and 140. The shuffling table 128 a performs anaddress conversion for the audio shuffling 137.

As described above, according to the embodiment of the presentinvention, a record data area (video sector and audio sector) and asystem area (sys) are formed as separate areas. At least part of theheader portion (the header of the sequence layer and the header of thepicture layer) is recorded in the system area. FIG. 23 shows thestructure of the recording process for the system area. The structure isdisposed in the record side MFC 106.

In FIG. 23, reference numeral 51 represents one input stream selectedfrom MPEG streams supplied from the MPEG encoder 102 and the SDTIreceiving portion 108. The input stream 51 may be a stream of whichcoefficient data has been rearranged. The input stream 51 is directlyoutput as an output stream 52 for a recording process. In addition, theinput stream 51 is supplied to a detecting portion 53.

The detecting portion 53 detects the header of the sequence layer andthe header of the picture layer from the input stream 51, detects allinformation of the headers or part of information necessary for thedecoding process, and separates the detected information from the inputstream 51. For example, the detecting portion 53 detects as informationcontained in the header of the sequence layer the number of pixels, bitrate, profile, level, color difference format, progressive sequence, andso forth and as information contained in the header of the picturelayer, information (flags) representing the setting of the accuracy ofDC (Direct Current) coefficient of an intra macro block, thedesignations of the frame structure, field structure, and display field,the selection of the quantizing scale, the selection of the VLC type,the selection of the zigzag/alternate scanning, and the designations ofthe chroma format and so forth.

Information 54 separated by the detecting portion 53 is recorded to thesystem area. In this case, as was described with reference to FIG. 16, asignal process is performed so that data of a sync block is structuredalong with other information recorded in the system area and that thesync block is recorded in the system area at a predetermined position ofa video sector.

FIG. 24 shows a signal processing portion disposed in the reproductionside MFC 114. An input stream denoted by 61 is a stream reproduced froma magnetic tape. An input denoted by 62 is data reproduced from thesystem area. These data is supplied to a selector 63. The selector 63has both a function for creating the header of the sequence layer andthe header of the picture layer corresponding to reproduced data 62 ofthe system area and a function for outputting one of the input stream 61and a stream with a header corresponding to the header of the inputstream 61 as an output stream 65. The selecting operation of theselector 63 is controlled corresponding to a mode 64. The mode 64 isdata that represents the operation mode of the digital VTR. The mode 64is output from the system controller 121 corresponding to the keyoperation of the user and so forth.

FIG. 25 is a flow chart showing a signal process on the reproductionside. First of all, at step S1, it is determined whether or not thereproducing operation is high speed reproduction mode corresponding tothe mode 64. When the reproducing operation is not the high speedreproducing mode, the header (the header of the sequence layer and theheader of the picture layer) contained in the input stream 61 is used asthe header of the output stream 65 (at step 62).

When the determined result at step S1 represents that the reproducingoperation is the high speed reproducing mode corresponding to the mode64, the header (the header of the sequence layer and the header of thepicture layer) is created corresponding to data reproduced from thesystem area (at step S3). The selector 63 outputs an output stream 65 ofwhich the created header has been added to the input stream 61. As aresult of such a process, the output stream 65 that is output from theselector 63 securely contains the header in the high speed reproducingmode.

In the high speed reproducing mode, the input stream 61 may contain aheader. In such a case, the header may be output as a valid header.However, when the packing process is performed according to theembodiment, since the depacking process is not performed in the highspeed reproducing mode, the header created corresponding to thereproduced data of the system area is used.

In the above example, both the header of the sequence layer and theheader of the picture layer are treated as fixed values and recorded tothe system area. However, since it is rarely that the header of thesequence layer is varied for each picture, the present invention may beapplied to the case that only the header of the picture layer isconsidered.

In the above example, the present invention is applied to a digital VTRthat records MPEG and JPEG data streams. In addition, the presentinvention can be applied to compression encoding having anotherhierarchical structure.

As was described above, according to the present invention, theinformation of headers of all frames is the same. Thus, even in the highspeed reproducing operation of which a stream of one frame is composedof fragmental data of different frames, the reproduced stream can besecurely decoded.

1. A recording apparatus for recording a digital video signal to arecording medium, comprising: means for recording a compression encodedstream in the recording medium, wherein a header has been added to thestream, wherein at least part of the header is recorded to a system areain said recording medium, wherein said system area is a separate areafrom a record area for the stream and said system area is securelyreproduced in a high speed reproducing operation in which the recordingmedium is traveled at higher speed than in a recording operation, andwherein macro blocks of a frame that are generated in the scanning orderare rearranged and record positions of the macro blocks are dispersed onthe recording medium.
 2. The recording apparatus as set forth in claim1, wherein in the stream, all the digital video signal has beencompressed by intra-frame encoding.
 3. The recording apparatus as setforth in claim 1, wherein the compression encoding generates a streamhaving a hierarchical structure, and wherein information recorded to thesystem area is information contained in the header added for each frame.4. The recording apparatus as set forth in claim 1, wherein thecompression encoding generates a stream having a hierarchical structure,and wherein information recorded to the system area is informationcontained in the header of the highest hierarchical level.
 5. Therecording apparatus as set forth in claim 1, wherein the recordingmedium is a tape shaped recording medium.
 6. A recording method forrecording a digital video signal to a recording medium, comprising thestep of: recording a compression encoded stream in the recording mediumwherein a header has been added to the stream, wherein at least part ofthe header is recorded to a system area in said recording medium,wherein said system area is a separate area from a record area for thestream and said system area is securely reproduced in a high speedreproducing operation in which the recording medium is traveled athigher speed than in a recording operation; and wherein macro blocks ofa frame that are generated in the scanning order are rearranged andrecord positions of the macro blocks are dispersed on the recordingmedium.
 7. A reproducing apparatus for reproducing a recording medium onwhich a compression encoded stream has been recorded, and a header hasbeen added to said stream, wherein at least part of the header has beenrecorded in a system area in said recording medium, wherein said systemarea is a separate area from a record area for the stream and saidsystem area is securely reproduced in a high speed reproducing operationin which the recording medium is traveled at higher speed than in arecording operation, wherein in the high speed reproducing operation,the reproduced stream is decoded using information contained in theheader reproduced from the system area, and wherein macro blocks of aframe that are generated in the scanning order are rearranged and recordpositions of the macro blocks are dispersed on the recording medium. 8.The reproducing apparatus as set forth in claim 7, wherein the header iscreated with information contained in the header reproduced from thesystem area, and wherein the reproduced stream is decoded correspondingto the created header.
 9. The reproducing apparatus as set forth inclaim 7, wherein the information reproduced from the system area isinformation contained in the header added for each frame.
 10. Thereproducing apparatus as set forth in claim 7, wherein the stream has ahierarchical structure, and wherein the information reproduced from thesystem area is information contained in the header of the highesthierarchical level.
 11. The reproducing apparatus as set forth in claim7, wherein the recording medium is a tape shaped recording medium.
 12. Areproducing method for reproducing a recording medium on which acompression encoded stream has been recorded, and a header has beenadded to said stream, wherein at least part of the header has beenrecorded in a system area in said recording medium, wherein said systemarea is a separate area from a record area for the stream and saidsystem area is securely reproduced in a high speed reproducing operationin which the recording medium is traveled at higher speed than in arecording operation, wherein in the high speed reproducing operation,the reproduced stream is decoded using information contained in theheader reproduced from the system area, and wherein macro blocks of aframe that are generated in the scanning order are rearranged and recordpositions of the macro blocks are dispersed on the recording medium. 13.A recording apparatus for recording a digital video signal to arecording medium, comprising: means for recording a compression encodedstream in the recording medium, wherein a header has been added to thestream, wherein information of the header added to each frame is thesame in all frames, wherein at least part of the header is recorded to asystem area, wherein said system area is a separate area from a recordarea for the stream and said system area is securely reproduced in ahigh speed reproducing operation in which the recording medium istraveled at higher speed than in a recording operation, and whereinmacro blocks of a frame that are generated in the scanning order arerearranged and record positions of the macro blocks are dispersed on therecording medium.
 14. A recording apparatus for recording a digitalvideo signal to a recording medium, comprising: a recording unitoperable to record a compression encoded stream in the recording mediumwherein a header has been added to the stream, wherein at least part ofthe header is recorded to a system area in said recording medium,wherein said system area is a separate area from a record area for thestream and said system area is securely reproduced in a high speedreproducing operation in which the recording medium is traveled athigher speed than in a recording operation, and wherein macro blocks ofa frame that are generated in the scanning order are rearranged andrecord positions of the macro blocks are dispersed on the recordingmedium.